package com.moter.one.wyydemo1.controller;

import com.moter.one.wyydemo1.entity.UserInfo;
import com.moter.one.wyydemo1.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeleteUser {
   @Autowired
    UserInfoService userInfoService;
   @CrossOrigin//如果从直接从html页面访问就需要加上这个跨域，如果从controller到html访问InsertUser就可以不用加
   @RequestMapping("/DeleteUser")
    public int DeleteUserInfo(@RequestBody UserInfo userInfo){
       int i = userInfoService.deleteUserInfoMapper(userInfo);
       System.out.println(i);
       return i;
   }
}
